// JavaScript Document
//xml异步提交 result:data[0]预定值 funName:传输正常时执行的函数
function do_ajax(url,result,funName){
	var http_request=new XMLHttpRequest();
	
	http_request.open("GET",url);
	http_request.send(null);
	
	http_request.onreadystatechange=function(){
		switch(http_request.readyState){
			case 0: break; case 1: break; case 2: break;
			case 4:
			var data=http_request.responseText;
			data=eval(data);
			if(data[0]==result) eval(funName);
			else alert("Cood is wrong!");
		}
	}
}

//屏幕滚动函数 nums:滚动屏幕数 speed:滚动速度
var tar_pos=0;
function screenScroll(nums,speed){
	var now_pos=document.body.scrollTop;
	if(tar_pos==0) tar_pos=now_pos+s_height*nums;
	if(now_pos>tar_pos&&now_pos-tar_pos>100){
		document.body.scrollTop-=speed;
		setTimeout("screenScroll("+nums+","+speed+")",10);
	}else if(now_pos<tar_pos&&tar_pos-now_pos>100){
		document.body.scrollTop+=speed;
		setTimeout("screenScroll("+nums+","+speed+")",10);
	}else{
		document.body.scrollTop=tar_pos;
		tar_pos=0;
	}
}
